home *** CD-ROM | disk | FTP | other *** search
- This file contains two small patches that correct problems with gcc-2.3.3
- that interfere with compilation of Ptolemy (gcc-2.2.2 will compile Ptolemy
- without changes).
-
- To apply the patches, cd to the gcc-2.3.3 sources directory and say
-
- patch < THIS_FILE
-
- where THIS_FILE is replaced with the name of this file. If you've
- already installed gcc, it suffices to simply rebuild cc1plus using
- your pre-installed gcc, saying something like
-
- make CC=gcc CFLAGS="-g -O" cc1plus
-
- You can then move cc1plus into the directory containing the compiler
- passes.
-
- The first patch corrects a problem with automatic type conversions that was
- introduced in 2.3.x. Here it is:
-
- *** cp-typeck.c.orig Mon Nov 23 17:48:44 1992
- --- cp-typeck.c Mon Jan 4 14:25:09 1993
- ***************
- *** 1597,1602 ****
- --- 1597,1610 ----
- return error_mark_node;
-
- itype = TREE_TYPE (index);
- + /* We must check here for the reference, so we can do the possible
- + conversions immediately afterwards. */
- + if (TREE_CODE (itype) == REFERENCE_TYPE)
- + {
- + index = convert_from_reference (index);
- + itype = TREE_TYPE (index);
- + }
- +
- if (IS_AGGR_TYPE (itype))
- {
- if (TYPE_HAS_INT_CONVERSION (itype))
- ***************
- *** 1608,1619 ****
- "type `%s' requires integer conversion for array indexing");
- return error_mark_node;
- }
- - }
- -
- - if (TREE_CODE (itype) == REFERENCE_TYPE)
- - {
- - index = convert_from_reference (index);
- - itype = TREE_TYPE (index);
- }
-
- if (TREE_CODE (TREE_TYPE (array)) == ARRAY_TYPE
- --- 1616,1621 ----
-
- This patch gets rid of warnings for global constants.
-
- *** cp-decl.c.orig Fri Dec 4 16:16:51 1992
- --- cp-decl.c Tue Jan 12 18:00:06 1993
- ***************
- *** 7302,7308 ****
- else if (specbits & 1 << (int) RID_EXTERN && initialized && !funcdef_flag)
- {
- if (current_binding_level == global_binding_level)
- ! warning ("`%s' initialized and declared `extern'", name);
- else
- error ("`%s' has both `extern' and initializer", name);
- }
- --- 7302,7313 ----
- else if (specbits & 1 << (int) RID_EXTERN && initialized && !funcdef_flag)
- {
- if (current_binding_level == global_binding_level)
- ! {
- ! /* warn only if a non-const global extern object has an initializer.
- ! "extern const" with initializer is completely legit in C++. */
- ! if ((specbits & 1 << (int) RID_CONST) == 0)
- ! warning ("`%s' initialized and declared `extern'", name);
- ! }
- else
- error ("`%s' has both `extern' and initializer", name);
- }
-